home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / utilities / emulators / apple2emul.lzh / mapper.c < prev    next >
C/C++ Source or Header  |  1991-04-18  |  785b  |  40 lines

  1.  
  2. #include    <stdio.h>
  3.  
  4.  
  5. /*
  6.  *  Map a disk image in Prodos block ordering to DOS 3.3 block ordering
  7.  *    usage:  mapper < old_image > new_image
  8.  */
  9.  
  10. main() {
  11. unsigned char buf[4096];
  12. int track;
  13.  
  14.     for (track = 0; track < 35; track++) {
  15.         if (read(0, buf, 4096) != 4096) {
  16.             perror("bad read");
  17.             exit(1);
  18.         }
  19.  
  20.         write(1, buf, 256);
  21.         write(1, &buf[0xE00], 256);
  22.         write(1, &buf[0xD00], 256);
  23.         write(1, &buf[0xC00], 256);
  24.         write(1, &buf[0xB00], 256);
  25.         write(1, &buf[0xA00], 256);
  26.         write(1, &buf[0x900], 256);
  27.         write(1, &buf[0x800], 256);
  28.         write(1, &buf[0x700], 256);
  29.         write(1, &buf[0x600], 256);
  30.         write(1, &buf[0x500], 256);
  31.         write(1, &buf[0x400], 256);
  32.         write(1, &buf[0x300], 256);
  33.         write(1, &buf[0x200], 256);
  34.         write(1, &buf[0x100], 256);
  35.         write(1, &buf[0xF00], 256);
  36.     }
  37. }
  38.  
  39.  
  40.